Electronic device including electronic pen and method of controlling communication connection between electronic device and electronic pen

ABSTRACT

An electronic device including an electronic pen and a method of controlling a communication connection with the electronic pen is provided. The electronic device include a housing, a touch-screen display, a first wireless communication circuit, an extended recess disposed inside the housing, a first wireless charging circuit,; an electronic pen including a second wireless communication circuit and a second wireless charging circuit electrically coupled to the first wireless charging circuit, a processor, and a memory. The memory stores instructions causing the processor to detect whether the electronic pen is inserted into the recess, charge the electronic pen through the first wireless charging circuit based on the detection, receive inherent information of the electronic pen through the first wireless communication circuit during or after the charging, and maintain or re-establish a communication connection with the electronic pen based on at least a portion of the received inherent information.

CROSS-REFERENCE TO RELATED APPLICATION(S)

This application is based on and claims priority under 35 U.S.C. §119(a) of a Korean patent application number 10-2018-0092716, filed onAug. 8, 2018, in the Korean Intellectual Property Office, the disclosureof which is incorporated by reference herein in its entirety.

BACKGROUND 1. Field

The disclosure relates to an electronic device including an electronicpen and a method of controlling a communication connection between theelectronic device and the electronic pen.

2. Description of Related Art

Electronic devices (e.g., mobile terminals, smartphones, or wearabledevices) may provide various functions. Smartphones may provide not onlya basic voice call function but also a Wi-Fi function, a Near FieldCommunication (NFC) function, a mobile communication (3^(rd)-Generation(3G), 4^(th)-Generation (4G), or 5^(th)-Generation (5G)) function, amusic or video reproduction function, a photographing function, or anavigation function.

Further, the electronic devices may support a function of short-rangewireless communication (using, e.g., Bluetooth Low Energy (BLE)) with anexternal electronic device.

The above information is presented as background information only toassist with an understanding of the disclosure. No determination hasbeen made, and no assertion is made, as to whether any of the abovemight be applicable as prior art with regard to the disclosure.

SUMMARY

External electronic devices (e.g., electronic pens) supportingshort-range wireless communication (e.g., BLE) with an electronic devicemay transmit an advertising signal and may connect for wirelesscommunication with the electronic device receiving the advertisingsignal. However, when there are a plurality of electronic devices withinthe range of the advertising signal, the external electronic device mayestablish the communication connection with another electronic devicerather than the target electronic device to which the externalelectronic device should be connected (e.g., the electronic device towhich the external electronic device is inserted).

Similarly, when there is a plurality of external electronic devices inthe vicinity of the electronic device and the plurality of externalelectronic devices transmits an advertising signal, the electronicdevice may connect for short-range wireless communication with anotherexternal electronic device rather than the target external electronicdevice (e.g., an electronic pen inserted into the electronic device).

Aspects of the disclosure are to address at least the above-mentionedproblems and/or disadvantages and to provide at least the advantagesdescribed below. Accordingly, an aspect of the disclosure, in order toconnect for communication with a target external electronic device(e.g., an electronic pen inserted into the electronic device), is toprovide the electronic device may apply charging power to the externalelectronic device and identify the target external electronic device onthe basis of inherent (or unique) information (e.g., a Bluetoothaddress) received from the external electronic device orcharging-related information.

Another aspect of the disclosure, when a target external electronicdevice (e.g., an electronic pen inserted into an electronic device)connected for communication is an external electronic device having aprevious connection history, is to provide the target externalelectronic device may maintain the communication connection, and whenthe target external electronic device is an external electronic devicehaving no previous connection history, the target external electronicdevice may perform a procedure for establishing the communicationconnection (e.g., pairing) with the target external electronic device.

Additional aspects will be set forth in part in the description whichfollows and, in part, will be apparent from the description, or may belearned by practice of the presented embodiments.

In accordance with an aspect of the disclosure, an electronic device isprovided. The electronic device includes a housing, a touch-screendisplay exposed through a portion of the housing, a first wirelesscommunication circuit disposed inside the housing, a recess disposedinside the housing, a first wireless charging circuit disposed insidethe housing so as to be adjacent to the recess, an electronic penincluding a second wireless communication circuit inserted to beremovable from the recess and configured to perform wirelesscommunication with the first wireless communication circuit, and asecond wireless charging circuit electrically coupled to the firstwireless charging circuit, a processor disposed inside the housing andoperatively connected to the first wireless communication circuit andthe first wireless charging circuit, and a memory operatively connectedto the processor. The memory stores instructions causing the processorto, when executed, detect whether the electronic pen is inserted intothe recess, charge the electronic pen through the first wirelesscharging circuit based on the detection, receive inherent information ofthe electronic pen through the first wireless communication circuitduring or after charging, and maintain or re-establish a communicationconnection with the electronic pen based on at least a portion of thereceived inherent information.

In accordance with another aspect of the disclosure, an electronicdevice is provided. The electronic device includes a housing, atouch-screen display exposed through a portion of the housing, a firstwireless communication circuit disposed inside the housing, a recessdisposed inside the housing, a first wireless charging circuit disposedinside the housing to be adjacent to the recess, a processor disposedinside the housing and operatively coupled to the display, the firstwireless communication circuit, and the first wireless charging circuit,and a memory operatively coupled to the processor, wherein the memorystores instructions causing the processor to, when executed, detectwhether an electronic pen is inserted into the recess, charge theelectronic pen through the first wireless charging circuit based on thedetection, perform a scan through the first wireless communicationcircuit in order to identify information on the electronic pen, turn onor off the first wireless charging circuit in a predetermined pattern inresponse to discovery of a plurality of electronic pens through thescan, identify the electronic pen inserted into the recess among theplurality of electronic pens based on charging-related informationincluded in advertising signals received from the plurality of foundelectronic pens, and establish a communication connection with theidentified electronic pen.

In accordance with another aspect of the disclosure, a method ofcontrolling a communication connection by an electronic device isprovided. The method includes detecting whether an electronic pen isinserted into a recess inside a housing, charging the electronic penthrough a wireless charging circuit based on the detection, receivinginherent information of the electronic pen through a wirelesscommunication circuit during or after charging, and maintaining orre-establishing the communication connection with the electronic penbased on at least a portion of the received inherent information.

Other aspects, advantages, and salient features of the disclosure willbecome apparent to those skilled in the art from the following detaileddescription, which, taken in conjunction with the annexed drawings,discloses various embodiments of the disclosure.

BRIEF DESCRIPTION OF THE DRAWINGS

The above and other aspects, features, and advantages of certainembodiments of the disclosure will be more apparent from the followingdescription taken in conjunction with the accompanying drawings, inwhich:

FIG. 1 illustrates an electronic device and an electronic pen accordingto an embodiment of the disclosure;

FIG. 2 is a block diagram of an electronic device within a networkenvironment according to an embodiment of the disclosure;

FIG. 3 is a block diagram of an electronic device according to anembodiment of the disclosure;

FIG. 4 illustrates the structure of an electronic pen according to anembodiment of the disclosure;

FIG. 5A is a flowchart illustrating a method of controlling acommunication connection with an electronic pen by an electronic deviceaccording to an embodiment of the disclosure;

FIG. 5B illustrates a method of controlling a communication connectionwith an electronic pen by an electronic device according to anembodiment of the disclosure;

FIG. 6 is a flowchart illustrating a method by which an electronicdevice controls a communication connection with an electronic penaccording to an embodiment of the disclosure;

FIG. 7A illustrates the application of charging power and a transmissionperiod of an advertising signal of an electronic pen according to anembodiment of the disclosure, and FIG. 7B illustrates the application ofcharging power and a transmission period of an advertising signal of anelectronic pen according to an embodiment of the disclosure;

FIG. 8 illustrates a method of verifying whether an electronic penconnected for communication is the same as an electronic pen beingcharged according to an embodiment of the disclosure;

FIG. 9 illustrates a method of verifying whether an electronic penconnected for communication is the same as an electronic pen beingcharged according to an embodiment of the disclosure;

FIG. 10 illustrates a method of verifying whether an electronic penconnected for communication is the same as an electronic pen beingcharged according to an embodiment of the disclosure;

FIG. 11 illustrates a method of verifying whether an electronic penconnected for communication is the same as an electronic pen beingcharged according to an embodiment of the disclosure;

FIG. 12 is a flowchart illustrating a method by which an electronicdevice controls a communication connection with an electronic penaccording to an embodiment of the disclosure;

FIG. 13 is a flowchart illustrating a method by which an electronicdevice controls the communication connection with an electronic penaccording to an embodiment of the disclosure; and

FIG. 14 illustrates an operation for a communication connection betweenan electronic device and an electronic pen according to an embodiment ofthe disclosure.

Throughout the drawings, it should be noted that like reference numbersare used to depict the same or similar elements, features, andstructures.

DETAILED DESCRIPTION

The following description with reference to the accompanying drawings isprovided to assist in a comprehensive understanding of variousembodiments of the disclosure as defined by the claims and theirequivalents. It includes various specific details to assist in thatunderstanding, but these are to be regarded as merely exemplary.Accordingly, those of ordinary skilled in the art will recognize thatvarious changes and modifications of the various embodiments describedherein can be made without departing from the scope and spirit of thedisclosure. In addition, descriptions of well-known functions andconstructions may be omitted for clarity and conciseness.

The terms and words used in the following description and claims are notlimited to the bibliographical meanings, but are merely used by theinventor to enable a clear and consistent understanding of thedisclosure. Accordingly, it should be apparent to those skilled in theart that the following description of various embodiments of thedisclosure is provided for illustration purposes only and not for thepurpose of limiting the disclosure as defined by the appended claims andtheir equivalents.

It is to be understood that the singular forms “a,” “an,” and “the”include plural referents unless the context clearly dictates otherwise.Thus, for example, reference to “a component surface” includes referenceto one or more of such surfaces.

Various embodiments of the disclosure may include an electronic deviceand an external electronic device capable of performing short-rangewireless communication (e.g., BLE). The electronic device may be variouselectronic devices that may provide charging power to the externalelectronic device. For example, the electronic device may be asmartphone, a tablet Personal Computer (PC), or a notebook PC. Theelectronic device may operate as a scanner and acharging-power-providing device.

The external electronic device may be any of various electronic devicesthat may receive charging power from the electronic device and transmitan advertising signal for a connection to short-range wirelesscommunication. For example, the external electronic device may include abattery and an accessory device, such as an electronic pen or aprotective case, which is inserted into a recess formed in one side ofthe electronic device, and may receive charging power from theelectronic device. The external electronic device may operate as anadvertiser.

The electronic device may be a vehicle supporting wireless charging andcommunication connection of the external electronic device (e.g., asmartphone). For example, when the smartphone is positioned at apredetermined location (e.g., a location at which a wireless chargingpad is installed), the vehicle may provide charging power to thesmartphone and establish a short-range wireless communication connectionwith the smartphone.

The electronic device may be an inspection device for checking whetherthe external electronic device (e.g., the smartphone) has an error. Forexample, when the smartphone is positioned at the predeterminedlocation, the inspection device may provide charging power to thesmartphone, establish the short-range wireless communication connectionwith the smartphone, and check whether the smartphone has an error.

Hereinafter, the case in which the external electronic device is anelectronic pen will be described by way of example for convenience ofdescription.

FIG. 1 illustrates an electronic device and an electronic pen accordingto an embodiment of the disclosure.

Referring to FIG. 1, an electronic pen (or a stylus pen) 10 according toan embodiment of the disclosure may be disposed inside a housing 21 ofan electronic device 20, and may be stored in a recess 22 so as to becapable of being removed therefrom. The electronic pen 10 may supportwireless communication (e.g., wireless communication based on aBluetooth protocol) and may include a rechargeable battery (not shown).The wireless communication may be Bluetooth Low Energy (BLE)communication.

When the electronic pen 10 is inserted into the electronic device 20,the electronic pen 10 may receive power from the electronic device 20and charge the battery with the received power. The electronic pen 10may output (e.g., broadcast) an advertising signal during charging. Forexample, the electronic pen 10 may output the advertising signal for apredetermined time (e.g., 25 seconds) at predetermined intervals (e.g.,100 ms). When the power of the battery is equal to or less than apredetermined level (e.g., 5%), the electronic pen 10 may first performcharging up to a predetermined level (e.g., 10%) and then output theadvertising signal. When the electronic pen 10 is removed from theelectronic device 20, the electronic pen 10 may output the advertisingsignal. For example, communication of the electronic pen 10 may bedisconnected due to an unknown error in the state in which theelectronic pen 10 is inserted into the electronic device 20. When theelectronic pen 10 is removed from the electronic device 20 in the statein which the communication connection with the electronic device 20 isdisconnected, the electronic pen 10 (e.g., a second wirelesscommunication circuit 409 of FIG. 4) may attempt the communicationconnection with the electronic device 20 by outputting the advertisingsignal. To this end, the electronic pen 10 may further include a means(e.g., a sensor) for detecting whether the electronic pen 10 is removedfrom the electronic device 20. When removal of the electronic pen 10from the electronic device 20 is detected, the electronic device 20 mayactivate (perform) a scan operation for a predetermined time (e.g., 20seconds).

When a predetermined button is input (e.g., pressed) for a predeterminedtime (e.g., 3 seconds), the electronic pen 10 may output the advertisingsignal. For example, when removal of the electronic pen 10 is detectedand the electronic pen 10 is not connected for communication for apredetermined time (e.g., 5 seconds), the electronic device 20 mayoutput a popup message indicating that the electronic pen 10 is notconnected for communication and indicating a connection method throughthe display. When detecting the removal or after outputting the popupmessage, the electronic device 20 may activate (perform) the scanoperation for a predetermined time (e.g., 20 seconds). The user mayattempt to establish the communication connection between the electronicdevice 20 and the electronic pen 10 by pressing a predetermined buttonof the electronic pen 10 for a predetermined time or longer and makingthe electronic pen 10 output the advertising signal.

The electronic device 20 according to an embodiment of the disclosuremay be a smartphone or a tablet Personal Computer (PC) into which theelectronic pen 10 can be inserted (attached or connected). Theelectronic device 20 may support wireless communication (e.g., wirelesscommunication based on a Bluetooth protocol) with the electronic pen 10.The wireless communication may be BLE communication.

When insertion of the electronic pen 10 is detected, the electronicdevice 20 may provide charging power to the electronic pen 10. Forexample, the electronic device 20 may detect insertion of the electronicpen 10 through various methods and charge a battery (not shown)positioned inside the electronic pen 10 by applying charging power tothe electronic pen 10. The method of detecting insertion of theelectronic pen 10 will be described below with reference to FIG. 5A.

The electronic device 20 may identify whether the inserted electronicpen 10 is an electronic pen having a previous communication connectionhistory (e.g., pairing). The electronic device 20 may compare referenceinherent (or unique) information (e.g., a device address) stored inmemory (not shown) with inherent information received from theelectronic pen connected for communication and identify whether theinserted electronic device 10 is an electronic pen having a previouscommunication connection history (e.g., pairing).

When the inserted electronic pen 10 is the electronic pen having theprevious communication connection history, the electronic device 20 maymaintain the communication connection. When the electronic pen 10 isinserted in the state in which the electronic pen 10 is connected forcommunication, the electronic device 20 may maintain the communicationconnection.

According to another embodiment of the disclosure, when the insertedelectronic pen 10 is not an electronic pen having a previouscommunication connection history, the electronic device 20 mayinitialize (e.g., reboot) the inserted pen 10 or delete (or format)pairing-related data and establish the communication connection with theinserted electronic pen 10. When the electronic pen 10 is inserted inthe state in which a communication connection with another electronicpen (not shown) has been established, the electronic device 20 mayterminate the communication connection with the other electronic pen andthen establish the communication connection with the inserted electronicpen 10 (or establish the communication connection after initialization).

When the number of electronic pens capable of establishing acommunication connection is plural, the electronic device 10 mayidentify the electronic pen inserted into the electronic device 10 amongthe plurality of electronic pens. For example, the electronic device 10may identify the electronic pen inserted into the electronic device 10among the plurality of electronic pens on the basis of the advertisingsignal or charging-related information. A detailed description thereofwill be given below with reference to FIGS. 8 to 11.

FIG. 2 is a block diagram illustrating an electronic device in a networkenvironment according to an embodiment of the disclosure.

Referring to FIG. 2, the electronic device 201 (e.g., the electronicdevice 20 of FIG. 1) in the network environment 200 may communicate withan electronic device 202 via a first network 298 (e.g., a short-rangewireless communication network), or an electronic device 204 or a server208 via a second network 299 (e.g., a long-range wireless communicationnetwork). The electronic device 201 may communicate with the electronicdevice 204 via the server 208. The electronic device 201 may include aprocessor 220, memory 230, an input device 250, a sound output device255, a display device 260, an audio module 270, a sensor module 276, aninterface 277, a haptic module 279, a camera module 280, a powermanagement module 288, a battery 289, a communication module 290, asubscriber identification module (SIM) 296, or an antenna module 297. Atleast one (e.g., the display device 260 or the camera module 280) of thecomponents may be omitted from the electronic device 201, or one or moreother components may be added in the electronic device 201. Some of thecomponents may be implemented as single integrated circuitry. Forexample, the sensor module 276 (e.g., a fingerprint sensor, an irissensor, or an illuminance sensor) may be implemented as embedded in thedisplay device 260 (e.g., a display).

The processor 220 may execute software (e.g., a program 240) to controlat least one other component (e.g., a hardware or software component) ofthe electronic device 201 coupled with the processor 220, and mayperform various data processing or computation. As at least part of thedata processing or computation, the processor 220 may load a command ordata received from another component (e.g., the sensor module 276 or thecommunication module 290) in volatile memory 232, process the command orthe data stored in the volatile memory 232, and store resulting data innon-volatile memory 234. The processor 220 may include a main processor221 (e.g., a central processing unit (CPU) or an application processor(AP)), and an auxiliary processor 223 (e.g., a graphics processing unit(GPU), an image signal processor (ISP), a sensor hub processor, or acommunication processor (CP)) that is operable independently from, or inconjunction with, the main processor 221. Additionally or alternatively,the auxiliary processor 223 may be adapted to consume less power thanthe main processor 221, or to be specific to a specified function. Theauxiliary processor 223 may be implemented as separate from, or as partof the main processor 221.

The auxiliary processor 223 may control at least some of functions orstates related to at least one component (e.g., the display device 260,the sensor module 276, or the communication module 290) among thecomponents of the electronic device 201, instead of the main processor221 while the main processor 221 is in an inactive (e.g., sleep) state,or together with the main processor 221 while the main processor 221 isin an active state (e.g., executing an application). The auxiliaryprocessor 223 (e.g., an image signal processor or a communicationprocessor) may be implemented as part of another component (e.g., thecamera module 280 or the communication module 290) functionally relatedto the auxiliary processor 223.

The memory 230 may store various data used by at least one component(e.g., the processor 220 or the sensor module 276) of the electronicdevice 201. The various data may include, for example, software (e.g.,the program 240) and input data or output data for a command relatedthereto. The memory 230 may include the volatile memory 232 or thenon-volatile memory 234.

The program 240 may be stored in the memory 230 as software, and mayinclude, for example, an operating system (OS) 242, middleware 244, oran application 246.

The input device 250 may receive a command or data to be used by othercomponent (e.g., the processor 220) of the electronic device 201, fromthe outside (e.g., a user) of the electronic device 201. The inputdevice 250 may include a microphone, a mouse, a keyboard, or a digitalpen (e.g., a stylus pen).

The sound output device 255 may output sound signals to the outside ofthe electronic device 201. The sound output device 255 may include aspeaker or a receiver. The speaker may be used for general purposes,such as playing multimedia or playing record, and the receiver may beused for an incoming calls. The receiver may be implemented as separatefrom, or as part of the speaker.

The display device 260 may visually provide information to the outside(e.g., a user) of the electronic device 201. The display device 260 mayinclude a display, a hologram device, or a projector and controlcircuitry to control a corresponding one of the display, hologramdevice, and projector. The display device 260 may include touchcircuitry adapted to detect a touch, or sensor circuitry (e.g., apressure sensor) adapted to measure the intensity of force incurred bythe touch.

The audio module 270 may convert a sound into an electrical signal andvice versa. The audio module 270 may obtain the sound via the inputdevice 250, or output the sound via the sound output device 255 or aheadphone of an external electronic device (e.g., an electronic device202) directly (e.g., wiredly) or wirelessly coupled with the electronicdevice 201.

The sensor module 276 may detect an operational state (e.g., power ortemperature) of the electronic device 201 or an environmental state(e.g., a state of a user) external to the electronic device 201, andthen generate an electrical signal or data value corresponding to thedetected state. The sensor module 276 may include a gesture sensor, agyro sensor, an atmospheric pressure sensor, a magnetic sensor, anacceleration sensor, a grip sensor, a proximity sensor, a color sensor,an infrared (IR) sensor, a biometric sensor, a temperature sensor, ahumidity sensor, or an illuminance sensor.

The interface 277 may support one or more specified protocols to be usedfor the electronic device 201 to be coupled with the external electronicdevice (e.g., the electronic device 202) directly (e.g., wiredly) orwirelessly. The interface 277 may include a high definition multimediainterface (HDMI), a universal serial bus (USB) interface, a securedigital (SD) card interface, or an audio interface.

A connecting terminal 278 may include a connector via which theelectronic device 201 may be physically connected with the externalelectronic device (e.g., the electronic device 202). The connectingterminal 278 may include a HDMI connector, a USB connector, a SD cardconnector, or an audio connector (e.g., a headphone connector).

The haptic module 279 may convert an electrical signal into a mechanicalstimulus (e.g., a vibration or a movement) or electrical stimulus whichmay be recognized by a user via his tactile sensation or kinestheticsensation. The haptic module 279 may include, for example, a motor, apiezoelectric element, or an electric stimulator.

The camera module 280 may capture a image or moving images. According toan embodiment, the camera module 280 may include one or more lenses,image sensors, image signal processors, or flashes.

The power management module 288 may manage power supplied to theelectronic device 201. The power management module 288 may beimplemented as at least part of a power management integrated circuit(PMIC).

The battery 289 may supply power to at least one component of theelectronic device 201. The battery 289 may include, for example, aprimary cell which is not rechargeable, a secondary cell which isrechargeable, or a fuel cell.

The communication module 290 may support establishing a direct (e.g.,wired) communication channel or a wireless communication channel betweenthe electronic device 201 and the external electronic device (e.g., theelectronic device 202, the electronic device 204, or the server 208) andperforming communication via the established communication channel Thecommunication module 290 may include one or more communicationprocessors that are operable independently from the processor 220 (e.g.,the application processor (AP)) and supports a direct (e.g., wired)communication or a wireless communication. The communication module 290may include a wireless communication module 292 (e.g., a cellularcommunication module, a short-range wireless communication module, or aglobal navigation satellite system (GNSS) communication module) or awired communication module 294 (e.g., a local area network (LAN)communication module or a power line communication (PLC) module). Acorresponding one of these communication modules may communicate withthe external electronic device via the first network 298 (e.g., ashort-range communication network, such as Bluetooth™, Wi-Fi direct, orinfrared data association (IrDA)) or the second network 299 (e.g., along-range communication network, such as a cellular network, theInternet, or a computer network (e.g., LAN or wide area network (WAN)).These various types of communication modules may be implemented as asingle component (e.g., a single chip), or may be implemented as multicomponents (e.g., multi chips) separate from each other. The wirelesscommunication module 292 may identify and authenticate the electronicdevice 201 in a communication network, such as the first network 298 orthe second network 299, using subscriber information (e.g.,international mobile subscriber identity (IMSI)) stored in thesubscriber identification module 296.

The antenna module 297 may transmit or receive a signal or power to orfrom the outside (e.g., the external electronic device) of theelectronic device 201. The antenna module 297 may include an antennaincluding a radiating element composed of a conductive material or aconductive pattern formed in or on a substrate (e.g., printed circuitboard (PCB)). The antenna module 297 may include a plurality ofantennas. In such a case, at least one antenna appropriate for acommunication scheme used in the communication network, such as thefirst network 298 or the second network 299, may be selected by thecommunication module 290 (e.g., the wireless communication module 292)from the plurality of antennas. The signal or the power may then betransmitted or received between the communication module 290 and theexternal electronic device via the selected at least one antenna.Another component (e.g., a radio frequency integrated circuit (RFIC))other than the radiating element may be additionally formed as part ofthe antenna module 297.

At least some of the above-described components may be coupled mutuallyand communicate signals (e.g., commands or data) therebetween via aninter-peripheral communication scheme (e.g., a bus, general purposeinput and output (GPIO), serial peripheral interface (SPI), or mobileindustry processor interface (MIPI)).

Commands or data may be transmitted or received between the electronicdevice 201 and the external electronic device 204 via the server 208coupled with the second network 299. Each of the electronic devices 202and 204 may be a device of a same type as, or a different type, from theelectronic device 201. All or some of operations to be executed at theelectronic device 201 may be executed at one or more of the externalelectronic devices 202, 204, or 208. For example, if the electronicdevice 201 should perform a function or a service automatically, or inresponse to a request from a user or another device, the electronicdevice 201, instead of, or in addition to, executing the function or theservice, may request the one or more external electronic devices toperform at least part of the function or the service. The one or moreexternal electronic devices receiving the request may perform the atleast part of the function or the service requested, or an additionalfunction or an additional service related to the request, and transferan outcome of the performing to the electronic device 201. Theelectronic device 201 may provide the outcome, with or without furtherprocessing of the outcome, as at least part of a reply to the request.To that end, a cloud computing, distributed computing, or client-servercomputing technology may be used, for example.

FIG. 3 is a block diagram of an electronic device according to anembodiment of the disclosure.

Referring to FIG. 3, an electronic device 301 (e.g., the electronicdevice 20 of FIG. 1 or the electronic device 201 of FIG. 2) according toan embodiment of the disclosure may include a processor 220, a memory230, a touch-screen display 330 (e.g., a display device 260 of FIG. 2),a first wireless charging circuit 340, and a first wirelesscommunication circuit 350 (e.g., the wireless communication module 292of FIG. 2).

The processor 220 may control the overall operation of the electronicdevice 301. For example, the processor 220 may be positioned inside ahousing (not shown) of the electronic device 301, and may be operatively(or electrically) connected to the memory 220, the touch-screen display330, the first wireless charging circuit 340, and the first wirelesscommunication circuit 350 so as to control each element of theelectronic device 301.

The processor 220 may include a digitization controller 211. Thedigitization controller 211 may transmit a position detection signalthrough a digitization panel 335 and receive a response signal from aresonant circuit of the electronic pen (e.g., the electronic pen 10 ofFIG. 1). The digitization controller 211 may determine positioninformation of the electronic pen by analyzing the received responsesignal. Alternatively, the digitization controller 211 may transmit adetection signal through a coil included in the first wireless chargingcircuit 340 and receive a signal from the electronic pen so as toidentify whether the electronic pen is physically or electricallyconnected. Alternatively, the digitization controller 211 may charge abattery (or a super capacitor) of the electronic pen by applying acharging signal of a higher voltage compared to the detection signal tothe coil of the first wireless charging circuit 340.

The digitization controller 211 may be a separate element. In this case,the processor 220 may perform control to receive insertion informationof the electronic pen (e.g., the electronic pen 10 of FIG. 1) from thedigitization controller 211, transmit a wireless communicationconnection command to the first wireless communication circuit 350 onthe basis of the received insertion information, and transmit a chargingsignal and a control signal to the digitization controller 211 on thebasis of data received from the first wireless communication circuit350. A detailed description of the processor 220 will be made below withreference to FIGS. 5A and 5B, 6, 7A and 7B, 8 to 13.

The memory 230 may be operatively (or electrically) connected to theprocessor 220. The memory 230 may include an Encrypting File System(EFS) area for storage of reference inherent information of the previousconnected electronic pen and/or pairing-related data (e.g., bondingdata) in the EFS area. The reference inherent information may include aBluetooth address of the previously connected electronic pen, and thepairing-related data is data generated when pairing is performed, andmay include one or more shared secret keys used for a securityconnection.

The touch-screen display 330 may be exposed through a portion of thehousing and may provide an input function and an output function. Forexample, the touch-screen display 330 may include a display panel 331, atouch panel 333, and a digitization panel 335. The display panel 331 maybe embodied as, for example, a Liquid Crystal Display (LCD), aLight-Emitting Diode (LED) display, an Organic Light-Emitting Diode(OLED) display, a Micro Electro Mechanical System (MEMS) display, or anelectronic paper display. The touch panel 333 may detect (or recognize)a change in physical characteristics (capacitance or frequency) throughvarious touch input (e.g., tap, double tap, touch, touch movement, ormulti-touch) using an input tool (e.g., a finger) and transmit the sameto the processor 220. The digitization panel 335 may detect anelectromagnetic change in response to input by the electronic pen andtransmit the same to the digitization controller 211 of the processor220. The touch-screen display 330 may further include a pressuredetection panel (not shown) for detecting pressure.

The first wireless charging circuit 340 according to an embodiment ofthe disclosure may be disposed adjacent to a recess (e.g., the recess 22of FIG. 1) formed inside the housing of the electronic device 301. Thefirst wireless charging circuit 340 may supply power for charging thebattery of the electronic pen inserted into the recess. The firstwireless charging circuit 340 may be turned on for a first predeterminedtime (e.g., 9 seconds) and turned off for a second predetermined time(e.g., 1 second) under the control of the processor 220. For example,the processor 220 may perform control to turn on or off the firstwireless charging circuit 340 before the battery of the electronic penis fully charged.

In order to identify (or verify) whether the pen currently connected forcommunication is the inserted pen, the first wireless charging circuit340 according to an embodiment of the disclosure may be turned on or offin a predetermined pattern under the control of the processor 220 or thedigitization controller 211.

The electronic device 301 may charge the electronic pen through thefirst wireless charging circuit 340, but the method of charging theelectronic pen is not limited to the wireless charging method. Forexample, the electronic device 301 may charge the electronic pen throughan electrically connected charging circuit (e.g., a wired chargingcircuit).

The first wireless communication circuit 350 may be disposed inside thehousing of the electronic device 301, and may connect a wirelesscommunication channel with an external electronic device (e.g., theelectronic pen 10 of FIG. 1). The first wireless communication circuit350 may receive inherent information from the electronic pen through theantenna 351 during or after charging of the electronic pen.

The first wireless communication circuit 350 may support a Bluetoothprotocol. For example, the first wireless communication circuit 350 maybe a BLE communication circuit. The first wireless communication circuit350 according to an embodiment of the disclosure may scan for aconnectable electronic pen when insertion of the electronic pen isdetected or a charging signal is applied. The first wirelesscommunication circuit 350 may receive an advertising signal of theelectronic pen. The advertising signal may include charging-relatedinformation.

The first wireless charging circuit 340 may be a separate elementseparated from the electronic device 301. The first wireless chargingcircuit 340 may establish the communication connection with theelectronic device 301 through a server and transmit and receive variousdata (e.g., charging-related information and/or communication connectionstate information).

Although not illustrated in FIG. 3, the electronic device 301 mayfurther include at least one other element (e.g., a camera module, anaudio module, or a sensor module) equivalent to the aforementionedelements.

FIG. 4 is a block diagram of an electronic pen according to anembodiment of the disclosure.

Referring to FIG. 4, an electronic pen 400 (e.g., the electronic pen 10of FIG. 1) according to an embodiment of the disclosure may include acoil 401, a trimmer capacitor 402, a button switch 403, a rectificationcircuit unit 405, a first voltage comparator 406, a charging switch 407,a second voltage comparator 408, a second wireless communication circuit409, an antenna 410, a booting switch 411, a battery 412, and an OR gate413. The rectification circuit unit 405 may be called a first voltagecomparator 406, and the charging switch 407 may be called a secondwireless charging circuit 404.

The coil 401 may be a resonant circuit that may detect anelectromagnetic field signal applied by an external device (e.g., thefirst wireless charging circuit 340 of the electronic device 10, 201, or301) and transmit a signal of a specific frequency. For example, thecoil 401 may be an Electromagnetic Resonance (EMR) coil. The trimmercapacitor 402 may store an induced current applied to the coil 401. Thebutton switch 403 may detect an input (pressing) of a button positionedat one side of the housing of the electronic pen 400. When the buttonswitch 403 is turned on, the resonant frequency of the coil 401 may bechanged. The electronic device may detect a button input through thechange in the resonant frequency.

The rectification circuit unit 405 according to an embodiment of thedisclosure may convert the alternating current (AC) power applied to thecoil 401 into direct current (DC) power and transmit the converted DCpower to the first voltage comparator 406 and the charging switch 407.

The first voltage comparator 406 may identify whether the DC power is aposition detection signal or a charging signal on the basis of thevoltage of the DC power provided from the rectification circuit unit405. For example, the charging signal may have a value larger than theposition detection signal. The first voltage comparator 406 maydetermine that the DC power is the position detection signal when the DCpower is smaller than a reference voltage (e.g., 3 V) and determine thatthe DC power is the charging signal when the DC power is larger than orequal to the reference voltage. When the DC power provided from therectification circuit unit 405 is the charging signal, the first voltagecomparator 406 may provide the second wireless communication circuit 409with a signal indicting that the electronic pen 400 is inserted into theelectronic device. Further, the first voltage comparator 406 may turn onthe charging switch 407 when the DC power is the charging signal, andmay turn off the charging switch 407 when the DC power is the positiondetection signal.

The charging switch 407 may control on/off of charging of the battery412. For example, the charging switch 407 may provide or block the DCpower provided from the rectification circuit unit 405 to the battery412 on the basis of the output from the first voltage comparator 406.

The electronic pen 400 may charge the battery 412 through the secondwireless charging circuit 404, but the method of charging the battery412 is not limited to the wireless charging method. For example, theelectronic pen 400 may charge the battery 412 through a charging circuit(e.g., a wired charging circuit) electrically connected to an externaldevice (e.g., the electronic device).

When the voltage of the battery 412 is larger than or equal to apredetermined voltage, the second voltage comparator 408 according to anembodiment of the disclosure may turn on (boot) the second wirelesscommunication circuit 409.

The second wireless communication circuit 409may be disposed inside thehousing of the electronic pen 400, and may perform wirelesscommunication with the first wireless communication circuit 350 of theexternal device (e.g., the electronic device 20, 201, or 301). Thesecond wireless communication circuit 409 may support a Bluetoothprotocol. For example, the second wireless communication circuit 409 maybe a BLE communication circuit.

The second wireless communication unit 409 may transmit stateinformation of the electronic pen 400 (e.g., inherent information orcharging-related information) and/or data based on a button input to thefirst wireless communication circuit through the antenna 410. Theantenna 410 may be electrically connected to the second wirelesscommunication circuit 409 and may transmit and receive a wirelesssignal.

The booting switch 411 may control on/off of the second wirelesscommunication circuit 409. For example, the booting switch 411 maysupply or block power of the battery 412 to the second wirelesscommunication circuit 409 on the basis of the output of the secondvoltage comparator 408.

The battery 412 is a rechargeable secondary cell, may be charged with DCpower from the rectification circuit unit 405, and may supply power tothe second wireless communication circuit 409. For example, the battery412 may be a super capacitor.

The OR gate 413 may provide a signal according to OR of the output ofthe first voltage comparator 404 and the button input to the secondwireless communication circuit 409.

According to various embodiments of the disclosure, an electronic device(e.g., the electronic device 10 of FIG. 1, the electronic device 201 ofFIG. 2, or the electronic device 301 of FIG. 3) may include a housing(e.g., the housing 21 of FIG. 1), a touch-screen display (e.g., thedisplay device 260 of FIG. 2 or the touch-screen display 330 of FIG. 3)exposed through a portion of the housing, a first wireless communicationcircuit (e.g., the wireless communication circuit 292 of FIG. 2 or thefirst wireless communication circuit 350 of FIG. 3) disposed inside thehousing, a recess (e.g., the recess 22 of FIG. 1) disposed inside thehousing, a first wireless charging circuit (e.g., the first wirelesscharging circuit 340) disposed inside the housing so as to be adjacentto the recess, an electronic pen (e.g., the electronic pen 10 of FIG. 1or the electronic pen 400 of FIG. 4) including a second wirelesscommunication circuit (e.g., the wireless communication module 292 ofFIG. 2 or the second wireless communication circuit 409 of FIG. 4)inserted to be removable from the recess and capable of performingwireless communication with the first wireless communication circuit anda second wireless charging circuit (e.g., the second wireless chargingcircuit 404 of FIG. 4) electrically coupled to the first wirelesscharging circuit, a processor (e.g., the processor 220 of FIG. 2 or 3)located inside the housing and operatively coupled to the display, thefirst wireless communication circuit, and the first wireless chargingcircuit, and a memory (e.g., the memory 230 of FIG. 2 or 3) operativelycoupled to the processor. The memory may store instructions causing theprocessor to, when executed, detect whether the electronic pen isinserted into the recess, charge the electronic pen through the firstwireless charging circuit based on the detection, receive inherentinformation of the electronic pen through the first wirelesscommunication circuit during or after charging, and maintain orre-establish a communication connection with the electronic pen based onat least a portion of the received inherent information.

The first wireless communication circuit may support a Bluetoothprotocol.

The inherent information may be a Bluetooth address of the electronicpen.

The instructions may cause the processor to store reference inherentinformation in the memory, compare the received inherent informationwith the reference inherent information, and maintain or re-establishthe communication connection according to a result of the comparison.

The re-establishing of the communication connection may comprise atleast one of rebooting of at least one of the first wirelesscommunication circuit and the second wireless communication circuit anddeletion of pairing-related data.

The inherent information may be included in an advertising signal of theelectronic pen, and the instructions may cause the processor to randomlyturn on or off the first wireless charging circuit in response toreception of a plurality of advertising signals from a plurality ofelectronic pens and maintain or re-establish the communicationconnection based on whether the advertising signal is synchronized withan on or off pattern of the first wireless charging circuit of theplurality of electronic pens.

The inherent information may be included in an advertising signal of theelectronic pen, and the instructions may cause the processor to randomlyturn on or off the first wireless charging circuit in response toreception of a plurality of advertising signals from a plurality ofelectronic pens and maintain or re-establish the communicationconnection based on whether charging-related information included in theadvertising signal is synchronized with an on or off pattern of thefirst wireless charging circuit of the plurality of electronic pens.

The inherent information may be included in an advertising signal of theelectronic pen, and the instructions may cause the processor to make arequest for reducing an intensity of the advertising signal of theelectronic pen connected for communication to a preset size or smallerin response to reception of a plurality of advertising signals from aplurality of electronic pens, maintain the communication connection withthe electronic pen in response to continuous reception of theadvertising signal having the reduced signal intensity, and re-establishthe communication connection with the electronic pen in response tonon-reception of the advertising signal having the reduced signalintensity.

The instructions may cause the processor to provide notification thatthe electronic pen inserted into the recess has an error when theinherent information is not received.

The instructions may cause the processor to apply charging power to theelectronic pen by periodically repeating on and off of the firstwireless charging circuit.

The electronic pen may be configured to transmit the advertising signalincluding the inherent information in an on period of the first wirelesscharging circuit, not to transmit the advertising signal in an offperiod of the first wireless charging circuit, to transmit theadvertising signal in an on period of the first wireless chargingcircuit, and stop transmission of the advertising signal aftermaintaining the transmission of the advertising signal for apredetermined time after turning off of the first wireless chargingcircuit.

According to various embodiments of the disclosure, an electronic device(e.g., the electronic device 10 of FIG. 1, the electronic device 201 ofFIG. 2, or the electronic device 301 of FIG. 3) may comprise a housing(e.g., the housing 21 of FIG. 1); a touch-screen display (e.g., thedisplay device 260 of FIG. 2 or the touch-screen display 330 of FIG. 3)exposed through a portion of the housing; a first wireless communicationcircuit (e.g., the wireless communication circuit 292 of FIG. 2 or thefirst wireless communication circuit 350 of FIG. 3) disposed inside thehousing; a recess (e.g., the recess 22 of FIG. 1) disposed inside thehousing; a first wireless charging circuit (e.g., the first wirelesscharging circuit 340) disposed inside the housing to be adjacent to therecess; a processor (e.g., the processor 220 of FIG. 2 or 3) locatedinside the housing and operatively coupled to the display, the firstwireless communication circuit, and the first wireless charging circuit;and a memory (e.g., the memory 230 of FIG. 2 or 3) operatively coupledto the processor. The memory stores instructions causing the processorto, when executed, detect whether an electronic pen is inserted into therecess, charge the electronic pen through the first wireless chargingcircuit based on the detection, perform a scan through the firstwireless communication circuit in order to identify information on theelectronic pen, turn on or off the first wireless charging circuit in apredetermined pattern in response to discovery of a plurality ofelectronic pens through the scan, identify the electronic pen insertedinto the recess among the plurality of electronic pens based oncharging-related information included in advertising signals receivedfrom the plurality of found electronic pens, and establish acommunication connection with the identified electronic pen.

FIG. 5A is a flowchart illustrating a method by which an electronicdevice controls a communication connection with an electronic penaccording to an embodiment of the disclosure, and FIG. 5B illustrates anexample of a method by which an electronic device controls acommunication connection with an electronic pen according to anembodiment of the disclosure.

Referring to FIGS. 5A and 5B, a processor (e.g., the processor 220 ofFIG. 2 or the processor 220 of FIG. 3) of an electronic device (e.g.,the electronic device 10 of FIG. 1, the electronic device 201 of FIG. 2,or the electronic device 301 of FIG. 3) may detect insertion of anelectronic pen (e.g., the electronic pen 10 of FIG. 1 or the electronic400 of FIG. 4) in operation 501. For example, the processor may detectwhether the electronic pen is inserted into a recess (e.g., the recess22 of FIG. 1) formed inside the housing of the electronic device. Theinsertion of the electronic pen may be detected through various methods.For example, the processor or the digitization controller 211 maytransmit a signal through a detection coil at a predetermined period andidentify whether a response signal is received from the electronic penso as to identify whether the electronic pen is inserted into theelectronic device. According to some embodiments, the processor maytransmit a signal for calculating the position of the electronic pen ata preset period through a digitization panel (e.g., the digitizationpanel 335 of FIG. 3) and receive a response signal from the electronicpen. The processor may determine whether the electronic pen is insertedinto the electronic device on the basis of position information of theelectronic pen recognized through the response. The electronic devicemay include a separate sensor, an electric switch, or a physical switchfor detecting the insertion or removal of the electronic pen.

The processor may apply charging power to the electronic pen inoperation 503. For example, the processor may apply charging power tothe electronic pen through a first wireless charging circuit (e.g., thefirst wireless charging circuit 340 of FIG. 3) disposed adjacent to therecess inside the housing. The processor may apply charging power to theelectronic pen according to a predetermined time or period. A detaileddescription thereof will be made below with reference to FIGS. 7A and7B.

The processor may receive inherent information of the electronic pen inoperation 505. For example, the processor may receive inherentinformation of the electronic pen through a first wireless communicationcircuit (e.g., the first wireless communication circuit 350 of FIG. 3)during or after charging of the electronic pen. The inherent informationmay be a device address included in an AdvA field of a payload of theadvertising signal, for example, a Bluetooth address.

The processor may maintain or re-establish the communication connectionwith the electronic pen on the basis of at least a portion of thereceived inherent information in operation 507. For example, theprocessor may compare the received inherent information with referenceinherent information (e.g., a device address of the electronic pen towhich the electronic device performed the communication connection)stored in an Encrypting File System (EFS) area of a memory (e.g., thememory 230 of FIG. 2 or 3), and when the received inherent informationmatches the reference inherent information, maintain the communicationconnection with the electronic pen. For example, when a previouslypaired electronic pen 51 is inserted into an electronic device 502, asindicated by reference numeral 510 of FIG. 5B, the processor maymaintain the communication connection with the electronic pen 51.

On the other hand, when the inherent information received from theelectronic pen does not match the reference inherent information storedin the EFS area of the memory, the processor may re-establish thecommunication connection with the inserted electronic pen. For example,when another electronic pen 52, not the electronic pen 51 thatpreviously performed the communication connection, is inserted into theelectronic device 502, as indicated by reference numeral 520 of FIG. 5B,the processor may disconnect the communication connection with theelectronic pen 51 and re-establish the communication connection with theinserted electronic pen 52. Re-establishing the communication connectionmay include at least one of rebooting at least one of a first wirelesscommunication circuit (e.g., the first wireless communication circuit350 of FIG. 3) of the electronic device 502 or a second wirelesscommunication circuit (e.g., the second wireless communication circuit409 of FIG. 4) of the electronic pen 51, or deletion of pairing-relateddata.

FIG. 6 is a flowchart illustrating a method by which an electronicdevice controls the communication connection with an electronic penaccording to an embodiment of the disclosure.

Referring to FIG. 6, a processor (e.g., the processor 220 of FIG. 2 or3) of an electronic device (e.g., the electronic device 10 of FIG. 1,the electronic device 201 of FIG. 2, or the electronic device 301 ofFIG. 3) may identify whether insertion (e.g., connection) of anelectronic pen (e.g., the electronic pen 10 of FIG. 1 or the electronicpen 400 of FIG. 4) is detected. For example, the processor may identifywhether the electronic pen is inserted into a recess (e.g., the recess22 of FIG. 1) formed inside the electronic device through any of variousmethods.

When it is determined that the electronic device is not inserted on thebasis of the result of the identification in operation 601, theprocessor may continue to perform operation 601. When it is determinedthat the electronic pen is inserted on the basis of the result of theidentification in operation 601, the processor may perform control sothat a wireless charging circuit (e.g., the first wireless chargingcircuit 340 of FIG. 3) applies charging power to the electronic pen inoperation 603. The processor may perform control so that the wirelesscharging circuit applies charging power to the electronic pen on thebasis of a predetermined time period. The method of applying thecharging power will be described below with reference to FIGS. 7A and7B.

When the charging power is applied, the electronic pen may transmit(e.g., broadcast) an advertising signal.

The processor may identify whether there is an electronic pen connectedfor communication in operation 605. For example, the processor mayidentify whether there is an electronic pen currently connected forcommunication with the electronic device on the basis of connectionstate information of an external device stored in a memory (e.g., thememory 230 of FIG. 2 or 3). When the connection state information of theexternal device that can be connected to the electronic device is storedin a server (e.g., the server 208 of FIG. 2), the processor may identifythe electronic pen through the server. Operation 605 is not limited tobeing performed after charging power is applied to the electronic pen,but may be performed when insertion of the electronic pen is detected orat a predetermined time.

When it is determined that there is no electronic pen connected forcommunication on the basis of the result of the identification inoperation 605, the processor control to activate a scan operation of awireless communication circuit (e.g., the first wireless communicationcircuit 350 of FIG. 3) in operation 613. The scan operation may be afilter scan, but the embodiments of the disclosure are not limitedthereto. The processor may search for (or discover) the electronic pen,which can be connected, by activating the scan operation. The scanoperation may be an operation for receiving an advertising signaltransmitted by the electronic pen. For example, the processor mayreceive the advertising signal transmitted by the electronic pen throughthe scan operation.

The processor may activate the scan operation when insertion of theelectronic pen is detected.

When an electronic pen connected for communication is discovered on thebasis of the result of the identification in operation 605, theprocessor may identify (verify) whether the electronic pen connected forcommunication is the same as the electronic pen (inserted pen) that isbeing charged in operation 607. For example, the processor may identify(verify) whether the electronic pen connected for communication is thesame as the electronic pen that is inserted into the electronic deviceand is being charged on the basis of attribute information indicatingthe charging state of the electronic pen. A description thereof will bemade below with reference to FIGS. 8 and 9.

Whether the electronic pen connected for communication is the same asthe electronic pen being charged may be identified by reducing theintensity of the advertising signal of the electronic pen being chargedor controlling the intensity of the advertising signal in apredetermined pattern. A detailed description thereof will be made belowwith reference to FIG. 10.

Whether the electronic pen connected for communication is the same asthe electronic pen being charged may be identified by controlling thetime at which charging power is applied in an embodiment of thedisclosure. This will be described below with reference to FIG. 11.

The electronic device may use a combination of one or more of thevarious verification methods described above (or described below withreference to FIGS. 8 to 11).

When the electronic pen connected for communication is determined to bethe same as the electronic pen being charged on the basis of the resultof the identification in operation 607, the processor may maintain thecommunication connection and the charging state in operation 609.

When the electronic pen connected for communication is determined not tobe the same as the electronic pen being charged on the basis of theresult of the identification in operation 607, for example, whencommunication with an electronic pen located outside the electronicdevice is connected, the processor may disconnect the communicationconnection with the electronic pen connected for communication inoperation 611 and proceed to operation 613.

Before performing operation 613 (the scan operation), the processor mayinitialize the inserted electronic pen. The initialization may includerebooting of a wireless communication circuit (e.g., the second wirelesscommunication circuit 409 of FIG. 4) within the electronic pen, deletionof pairing-related data, or disconnection. The initialization may beperformed using a charging signal. For example, the processor may applya charging signal to the inserted electronic pen for a predeterminedtime or longer for initialization of the electronic pen. The electronicpen receiving the charging signal for the predetermined time or longerfrom the electronic device may perform the initialization operation.After the initialization is completed, the electronic pen may transmitthe advertising signal and the electronic device may perform a scan.

The processor may control so that the wireless communication circuitconnects for communication with the inserted electronic pen in operation615. For example, when the inserted electronic pen is found through thescan operation of the wireless communication circuit, the processor mayestablish the communication connection with the inserted electronic penthrough the wireless communication circuit. At this time, the insertedelectronic pen may be in a charging state through charging power appliedin operation 603. When a plurality of advertising signals is receivedthrough the scan operation, the processor may perform a verificationprocedure by combining one or more of the various verification methodsdescribed above (or described below with reference to FIGS. 8 to 11) inorder to identify (select) the electronic pen currently inserted intothe electronic device. Alternatively, when no electronic pen is foundafter the scan is completed, the processor may again perform the scanoperation a predetermined number of times (e.g., three times). Theprocessor may output a screen inquiring about whether to again performthe scan on a display (e.g., the display device 260 of FIG. 2) and againperform the scan or cancel the scan operation according to the user'sselection. When no electronic pen is found after the scan is completedor the rescan is performed a predetermined number of times, theprocessor may notify the user of an error of the electronic device orthe electronic pen.

FIG. 7A illustrates the application of charging power and a transmissionperiod of an advertising signal of an electronic pen according to anembodiment of the disclosure, and FIG. 7B illustrates the application ofcharging power and a transmission period of an advertising signal of anelectronic pen according to an embodiment of the disclosure.

Referring to FIGS. 7A and 7B, when insertion of an electronic pen 710(e.g., the electronic pen 10 of FIG. 1 or the electronic pen 400 of FIG.4) is detected, a processor (e.g., the processor 220 of FIG. 2 or FIG.3) of an electronic device 720 (e.g., the electronic device 20 of FIG.1, the electronic device 201 of FIG. 2, or the electronic device 301 ofFIG. 3) may apply charging power to the electronic pen 710 bycontrolling a wireless charging circuit (e.g., the first wirelesscharging circuit 340 of FIG. 3). For example, when the electronic pen710 is inserted into the electronic device 720, as illustrated in FIG.7A, the processor may repeat an operation for controlling the wirelesscharging circuit to apply charging power to turn on charging for a firstpredetermined time (e.g., 9 seconds) and controlling the wirelesscharging circuit not to apply charging power (to turn off charging) fora second predetermined time (e.g., 1 second). Meanwhile, as illustratedin FIG. 7A, the electronic pen 710 may transmit the advertising signalwhile charging is performed (while charging is on), and when chargingends (charging is off), may stop transmission of the advertising signal.For example, the electronic pen 710 may be configured to transmit theadvertising signal during an on period of the wireless charging circuitand not to transmit the advertising signal during an off period of thewireless charging circuit.

The processor may add an electronic pen scanned for (found) at the onperiod of the wireless charging circuit to a candidate list. On theother hand, the processor may add an electronic pen scanned for (found)at the off period of the wireless charging circuit to a blacklist. Theelectronic pen added to the blacklist may be removed from the candidatelist of the inserted electronic pen. This operation may be repeateduntil only one electronic pen is left in the candidate list.

In order to prevent misrecognition of the charging state of theelectronic pen during the charging off period, in which charging poweris not applied even though charging has not actually ended, theelectronic pen may transmit the advertising signal while charging isperformed, maintain transmission of the advertising signal for a thirdpredetermined time (e.g., 1 second) after charging ends, and stoptransmission of the advertising signal after the third predeterminedtime passes, as illustrated in FIG. 7B. The third predetermined time maybe set as a value larger than or equal to the second predetermined time.When the third predetermined time is configured to be longer than orequal to the second predetermined time, as described above, charging isturned on after the second predetermined time, so that the advertisingsignal may be transmitted at the charging on period and the charging offperiod.

When charging power is applied from the electronic device after theelectronic pen is inserted, the electronic pen may charge the batteryand identify the power (e.g., a voltage) of the battery, and when thepower (voltage) of the battery satisfies a preset condition (e.g.,higher than or equal to 10% of full power), transmit the advertisingsignal. The electronic pen may transmit the advertising signal includingstate information indicating that the electronic pen is being charged.The electronic pen may change the state information included in theadvertising signal so as to indicate that charging is off after thethird predetermined time passes. Even though the electronic pen isactually in the charging off state between the charging off and thethird predetermined time, the electronic pen may transmit theadvertising signal including state information indicating a charging onstate.

FIG. 8 illustrates a method of verifying whether the electronic penconnected for communication is the same as the electronic pen beingcharged according to an embodiment of the disclosure.

Referring to FIG. 8, an electronic device 820 (e.g., the electronicdevice 20 of FIG. 1, the electronic device 201 of FIG. 2, or theelectronic device 301 of FIG. 3) according to an embodiment of thedisclosure may verify (identify) whether the electronic pen 810 (e.g.,the electronic pen 10 of FIG. 1 or the electronic pen 400 of FIG. 4)connected for communication is the same as the electronic pen which isinserted and being charged. For example, the electronic device 820 mayperform the verification by identifying attribute information indicatingthe charging state of the electronic pen through a notification.Hereinafter, the case in which the electronic pen 810 connected forcommunication is inserted into the electronic device 820 will bedescribed by way of example.

When the electronic device 820 receives an insertion event of theelectronic pen 810 as indicated by reference numeral 801, the electronicdevice 820 may apply a charging signal to the electronic pen 810, asindicated by reference numeral 803 and read attribute informationindicating a charging state so as to check the charging state, asindicated by reference numeral 805. At this time, the insertedelectronic pen 810 may be using a high slave latency value to operatewith low power and may exchange a signal with the electronic device 820at a period shorter than the slave latency in case of receiving a readcommand of the electronic device 820 when the charging signal isapplied.

When the electronic pen 810 connected for communication to theelectronic device 820 does not respond to the read command within apredetermined time or when a response indicating that charging is beingperformed is received, the electronic device 820 may consider that theelectronic pen 810 connected for communication is different from theelectronic pen inserted into a recess (e.g., the recess 22 of FIG. 1) ofthe electronic device 820.

On the other hand, when a response indicating the electronic pen 810connected for communication is being charged is received, the electronicdevice may verify whether the electronic pen 810 connected forcommunication is the same as the electronic pen being charged. This isperformed because, if the determination is performed on the basis onlyof charging state information, when the electronic pen 810 connected forcommunication is inserted into another electronic device in the vicinity(within a communication range of the electronic device) and is beingcharged, the electronic pen 810 connected for communication is mistakenfor the electronic pen inserted into the electronic device 820 eventhough the electronic pens are different from each other.

The electronic device 820 may register a notification in attributeinformation indicating the charging state of the electronic pen, asindicated by reference numeral 807, turn off and then turn on thecharging signal in a predetermined pattern during the charging onperiod, as indicated by reference numeral 809, and identify whether theattribute information is synchronized and changed through thenotification. When an on/off change of the charging signal is the sameas the change in attribute information indicating the charging statereceived through the notification, or when the attribute information issynchronized, the electronic device may determine that the electronicpen 810 connected for communication is the same as the electronic penthat is inserted and being charged. When the changes are not the same,the electronic device may determine that the electronic pen connectedfor communication is different from the electronic pen that is insertedand being charged. When the verification is completed, the processor mayrelease the registration of the notification, as indicated by referencenumeral 811.

According to some embodiments, when the number of electronic pens havinga charging state change which is the same as the on/off pattern of thecharging signal is plural, the electronic device 820 may change theon/off pattern of the charging signal and repeat the verificationprocess until only one electronic pen is detected.

The electronic device may register the notification when thecommunication connection with the electronic pen is established.

In order to maintain a low-power state, the electronic pen may prevent aresponse delay of the electronic pen that may be generated due to theuse of a high slave latency value. When the charging signal is applied,the electronic pen may perform communication at a predetermined period(e.g., a BLE connection interval or a separately configured interval)shorter than the slave latency for a predetermined time or a chargingtime regardless of the slave latency in order to rapidly share thecharging state of the electronic pen. Accordingly, it is possible toprevent the delay of sharing of the charging state due to the high slavelatency value in embodiments of the disclosure.

FIG. 9 illustrates a method of verifying whether the electronic penconnected for communication is the same as the electronic pen beingcharged according to an embodiment of the disclosure.

Referring to FIG. 9, an electronic device 920 according to an embodimentof the disclosure may identify whether the electronic pen 910 connectedfor communication is the same as the electronic pen that is inserted andbeing charged through an indication. For example, when the electronicdevice 920 receives an insertion event of the electronic pen 910connected for communication, as indicated by reference numeral 901, theelectronic device 920 may apply a charging signal to the insertedelectronic pen 910, as indicated by reference numeral 903, and readattribute information indicating a charging state so as to check thecharging state, as indicated by reference numeral 905.

The electronic device 920 may register an indication in attributeinformation indicating the charging state of the electronic pen, asindicated by reference numeral 907, and perform verification by turningon/off the charging signal in a predetermined pattern at a charging onperiod, as indicated by reference numeral 909. When the predeterminedoff/on pattern of the charging signal is the same as the change patternof the attribute information indicating the charging state receivedthrough the indication, the electronic device may determine that theelectronic pen 910 connected for communication is the same as theelectronic pen that is inserted and being charged. When the number ofelectronic pens having a charging state change the same as thepredetermined off/on pattern of the charging signal is plural, theelectronic device 920 may change the off/on pattern of the chargingsignal and repeat the verification process until only one electronic penis detected. When the change patterns are not the same as each other,the electronic device may determine that the electronic pen connectedfor communication is different from the electronic pen that is insertedand being charged. When the verification is completed, the processor mayrelease the registration of the indication, as indicated by referencenumeral 911.

When the electronic device 920 does not receive a response signal of aread command from the electronic pen 910 connected for communicationwithin a predetermined time, or when a response indicating that chargingis not being performed is received, the electronic device 920 maydetermine that the electronic pen 910 connected for communication isdifferent from the electronic pen inserted into the electronic device920.

The electronic pen 910 may share the charging state with the electronicdevice using a high slave latency value for operation with low power.According to some embodiments, in order to rapidly share the chargingstate with the electronic device, the electronic pen 910 may exchange asignal with the electronic device 920 at a shorter period than the slavelatency when the charging is applied.

FIG. 10 illustrates a method of verifying whether the electronic penconnected for communication is the same as the electronic pen beingcharged according to an embodiment of the disclosure.

Referring to FIG. 10, it is possible to verify whether the electronicpen connected for communication is the same as the electronic pen beingcharged by reducing the intensity of the advertising signal to apredetermined magnitude according to an embodiment. For example, whenthe electronic pen 11 is inserted into an electronic device 1001 andcharging power is applied, the electronic pen 11 may transmit theadvertising signal having an intensity within a predetermined range 11a, as illustrated in FIG. 10. When the electronic pen 11 is insertedinto the electronic device 1001, the predetermined range 11 a may be setas the minimum range within which an antenna (e.g., the antenna 351 ofFIG. 3) of a wireless communication circuit (e.g., the first wirelesscommunication circuit 350) of the electronic device 1001 is capable ofdetecting the advertising signal. Accordingly, the electronic device1001 may not receive an advertising signal transmitted by an electronicpen inserted into another electronic device, not the electronic pen 11inserted into the electronic device 1001 itself, or may receive theadvertising signal with a very low signal intensity.

A processor (e.g., the processor 220 of FIG. 2 or 3) of the electronicdevice 1001 may verify whether the electronic pen connected forcommunication is the same as the electronic pen being charged bycontrolling the intensity of the advertising signal of the electronicpen 11. For example, the processor may control the electronic penconnected for communication so as to transmit the advertising signalhaving intensity reduced to a predetermined intensity or lower when theelectronic pen is inserted. When the advertising signal is continuouslyreceived after the intensity of the advertising signal is reduced, theprocessor may determine that the electronic pen connected forcommunication is the same as the electronic pen that is inserted intothe electronic device and is being charged. On the other hand, when theadvertising signal is not received after the intensity of theadvertising signal is reduced, the processor may determine that theelectronic pen connected for communication is inserted into anotherelectronic device or is located outside the electronic device 1001.

When a plurality of advertising signals is received even after thesignal of the advertising signal is reduced, the processor of theelectronic device may perform control to reduce the intensity of theadvertising signal by a predetermined amount until one advertisingsignal is received. In another example, the processor may recognize theadvertising signal of the inserted electronic pen among the plurality ofadvertising signals by controlling a charging time (e.g., increasing thetime to 9.3 seconds).

The processor of the electronic device may control the intensity of theadvertising signal according to a predetermined pattern, identifywhether the intensity of the received signal is changed in accordancewith the predetermined pattern, and verify whether the electronic penconnected for communication is the same as the electronic pen beingcharged.

It is possible to recognize the inserted electronic pen by increasingthe intensity of the advertising signal. For example, the processor ofthe electronic device may recognize that the electronic pen transmittingthe advertising signal having an intensity higher than a predeterminedadvertising signal intensity is the inserted electronic pen.

FIG. 11 illustrates a method of verifying whether the electronic penconnected for communication is the same as the electronic pen beingcharged according to an embodiment of the disclosure.

Referring to FIG. 11, an electronic device 1120 (e.g., the electronicdevice 20 of FIG. 1, the electronic device 201 of FIG. 2, or theelectronic device 301 of FIG. 3) according to an embodiment of thedisclosure may verify whether the electronic pen connected forcommunication is the same as the electronic pen being charged bycontrolling an application time of charging power. For example, if anelectronic pen 1110 (e.g., the electronic pen 10 of FIG. 1 or theelectronic pen 400 of FIG. 4) is configured to transmit the advertisingsignal only when the electronic pen 1110 is being charged, theelectronic device 1120 may turn on/off a charging signal in apredetermined pattern at a charging period, and when the receivedadvertising signal corresponds to (e.g., is synchronized with) on/off ofthe charging signal, determine that the electronic pen 1110 connectedfor communication is the same as the electronic pen being charged.

When the electronic pen 1110 transmits the advertising signal includingcharging-related information, the electronic device 1120 may turn on/offthe charging signal according to a predetermined pattern, and when thecharging-related information included in the received advertising signalcorresponds to (is synchronized with) the predetermined pattern,determine that the electronic pen 1110 connected for communication isthe same as the electronic pen being charged. When the number ofelectronic pens having charging-related information that is the same asthe predetermined on/off pattern of the charging signal is plural, theelectronic device 1120 may change the predetermined on/off pattern ofthe charging signal and repeat the verification process until only oneelectronic pen is detected.

When the electronic pen 1110 is configured to transmit charging-relatedinformation to the electronic device 1120 connected for communication,the electronic device 1120 may turn on/off the charging signal in apredetermined pattern, and when the charging-related informationincluded in the signal transmitted by the electronic pen 1110 connectedfor communication corresponds to (is synchronized with) thepredetermined pattern, determine that the electronic pen 1110 connectedfor communication is the same as the electronic pen being charged.

FIG. 12 is a flowchart illustrating a method by which an electronicdevice controls a communication connection with an electronic penaccording to an embodiment of the disclosure.

Referring to FIG. 12, a processor (e.g., the processor 220 of FIG. 3) ofan electronic device (e.g., the electronic device 10 of FIG. 1, theelectronic device 201 of FIG. 2, the electronic device 301 of FIG. 3,the electronic device 502 of FIG. 5B, the electronic device 720 of FIGS.7A and 7B, the electronic device 820 of FIG. 8, the electronic device920 of FIG. 9, the electronic device 1001 of FIG. 10, or the electronicdevice 1120 of FIG. 11) according to an embodiment of the disclosure maydetect insertion of an electronic pen (e.g., the electronic pen 10 ofFIG. 1, the electronic pen 400 of FIG. 4, the electronic pen 51 or 52 ofFIG. 5B, the electronic pen 710 of FIGS. 7A and 7B, the electronic pen810 of FIG. 8, the electronic pen 910 of FIG. 9, the electronic pen 11of FIG. 10, or the electronic pen 1110 of FIG. 11) in operation 1201.

When insertion of the electronic pen is detected, the processor maycontrol a wireless charging circuit (e.g., the first wireless chargingcircuit 340 of FIG. 3) to apply charging power to the insertedelectronic pen in operation 1202. Since a method of applying thecharging power has been described with reference to FIGS. 7A and 7B, adetailed description thereof is omitted. The electronic pen to which thecharging power is applied may output an advertising signal.

The processor may identify whether there is an electronic pen connectedfor communication in operation 1203.

When an electronic pen connected for communication is discovered on thebasis of the result of identification in operation 1203, the processormay identify whether the electronic pen connected for communication isthe same as the inserted electronic pen in operation 1205. For example,when an electronic pen is connected for communication, the processor maynot activate a scan mode but may identify whether the electronic penconnected for communication is the same as the inserted electronic penthrough the various methods described with reference to FIGS. 8 to 11.When the electronic device is capable of simultaneously establishingcommunication connections with each of a plurality of electronic pens,the processor may activate the scan even though an electronic pen isalready connected for communication. In this case, the processor mayidentify whether the electronic pen connected for communication is thesame as the inserted electronic pen by comparing reference inherentinformation of the electronic pen connected for communication withinherent information included in the advertising signal transmitted bythe inserted electronic pen.

When the electronic pen connected for communication is determined to bethe same as the inserted electronic pen on the basis of the result ofidentification in operation 1205, the processor may maintain thecommunication connection in operation 1207. On the other hand, when theelectronic pen connected for communication is determined not to be thesame as the inserted electronic pen on the basis of the result ofidentification in operation 1205, the processor may initialize theinserted electronic pen in operation 1209.

The processor may notify the user that another electronic pen isinserted before performing operation 1209. The processor may alternatelynotify the user that the electronic pen is changed after operation 1209.For example, the processor may notify the user of insertion of anotherelectronic pen or a change of the electronic pen through a visual method(e.g., output of a popup message on the display), an auditory method(e.g., output of an audio signal through a speaker), or a tactile method(e.g., output of vibration of a predetermined pattern through avibration motor).

The processor may display a popup message inquiring about whether tochange the electronic pen on the display before operation 1209 andperform operation 1209 in response to reception of user input making arequest for changing the electronic pen. The processor may terminate thecommunication connection procedure in response to reception of userinput requesting that the electronic pen not be changed.

The processor may maintain the communication connection with theelectronic pen connected for communication before operation 1209 andnotify the user that another electronic pen has been inserted.Maintaining the communication connection with the electronic pen meansthat the electronic pen connected for communication is located near theelectronic device, and this is because the user can easily replace theelectronic pen inserted into the electronic device with the electronicpen. When establishment of the communication connection with theelectronic pen connected for communication is released before the userreplaces the electronic pen, the processor may perform operation 1209.

When it is determined that there is no electronic pen connected forcommunication on the basis of the result of identification in operation1203, the processor may control the wireless communication circuit(e.g., the first wireless communication circuit 350 of FIG. 3) to scanfor the electronic pen in operation 1233. For example, the processor mayreceive an advertising signal transmitted by at least one electronic penin the vicinity by controlling the wireless communication circuit.

The processor may identify whether a previously paired electronic pen isfound in operation 1235. For example, the processor may identify whethera previously paired electronic pen is included in at least one currentlyfound electronic pen by comparing reference inherent information storedin the memory with inherent information included in at least onereceived advertising signal.

When the previously paired electronic pen is included in at least oneelectronic pen found on the basis of the result of identification inoperation 1235, the processor may connect for communication with thepreviously paired electronic pen in operation 1243. This is because theuser seldom changes an electronic pen that has been used. However, theembodiments of the disclosure are not limited thereto. For example, whena new electronic pen is inserted into the electronic device and theelectronic pen that the user used (e.g., the previously pairedelectronic pen) is inserted into another nearby electronic device, aproblem may occur with the communication connection with the previouslypaired electronic pen. In order to prevent this problem, a verificationprocedure for identifying whether the inserted electronic pen is thepreviously paired electronic pen through the various methods describedwith reference to FIG. 11 may be performed.

On the other hand, when the previously connected electronic pen is notincluded in the at least one electronic pen found on the basis of theresult of identification in operation 1235, the processor may identifywhether the number of found electronic pens is one in operation 1237.When one electronic pen is found on the basis of the result ofidentification in operation 1237, the processor may connect forcommunication with the one found electronic pen in operation 1245. Theprocessor may perform a verification procedure for identifying whetherthe one found electronic pen is the same as the inserted electronic penthrough the various methods described with reference to FIG. 11. This isbecause one electronic pen inserted into another electronic device orone electronic pen located outside the electronic device may be foundwhen a broken electronic pen is inserted into the electronic device.

When the number of found electronic pens is determined not to be one onthe basis of the result of identification in operation 1237, forexample, when the number of found electronic pens is two or more, theprocessor may recognize (determine or select) the electronic peninserted into the electronic device from among the plurality ofelectronic pens in operation 1239. For example, the processor mayrecognize the electronic pen actually inserted into the electronicdevice through the various methods described with reference to FIG. 11.

The processor may connect for communication with the recognizedelectronic pen in operation 1241.

Although not illustrated, when no electronic pen is found on the basisof the result of the scan in operation 1233, the processor may notifythe user of breakdown of the electronic pen. According to someembodiments, when no electronic pen is found, the processor mayinitialize the inserted electronic pen and perform the scan operationagain. This is because the electronic pen inserted into the electronicdevice is connected for communication with another electronic device andthus may not be found when the scan is performed.

FIG. 13 is a flowchart illustrating a method by which an electronicdevice controls the communication connection with an electronic penaccording to an embodiment of the disclosure.

Referring to FIG. 13, a processor (e.g., the processor 220 of FIG. 2 or3) of an electronic device (e.g., the electronic device 10 of FIG. 1,the electronic device 201 of FIG. 2, the electronic device 301 of FIG.3, the electronic device 502 of FIG. 5B, or the electronic device 1001of FIG. 10) may detect insertion of an electronic pen in operation 1301.The insertion of the electronic pen may be detected through any ofvarious methods. Since a detailed description thereof has been madeabove, the description will be omitted.

The processor may control a wireless charging circuit (e.g., the firstwireless charging circuit 340 of FIG. 3) to apply charging power to theinserted electronic pen in operation 1303. Since a method of applyingthe charging power has been described with reference to FIGS. 7A and 7B,a detailed description thereof is omitted. The electronic pen to whichthe charging power is applied may output an advertising signal.

The processor may scan for at least one electronic pen by controllingthe wireless communication circuit (for example, the first wirelesscommunication circuit 350 of FIG. 3) in operation 1305. For example, theprocessor may receive an advertising signal transmitted by at least oneelectronic pen through the wireless communication circuit.

The processor may identify whether an electronic pen is found inoperation 1307. When an electronic pen is found on the basis of theresult of identification in operation 1307, the processor may identifywhether the number of found electronic pens is two or more in operation1309.

When the number of found electronic pens is two or more on the basis ofthe result of identification in operation 1309, the processor mayrecognize an inserted electronic pen among the plurality of foundelectronic pens in operation 1311. For example, the processor mayrecognize (determine/select) the electronic pen actually inserted intothe electronic device through the various methods described withreference to FIG. 11.

The processor may establish the communication connection with therecognized electronic pen in operation 1313.

When no electronic pen is found on the basis of the result ofidentification in operation 1307, the processor may provide notificationof an error of the electronic pen in operation 1333. For example, theprocessor may output a popup message to the display, output apredetermined audio signal through a speaker, or output a vibration in apredetermined pattern through a vibration motor.

The processor may initialize the inserted electronic pen beforeproviding notification of the error of the electronic pen and performthe scan operation again. This is because the electronic pen insertedinto the electronic device is connected for communication with anotherelectronic device and thus may not be found.

When the number of electronic pens is not plural on the basis of theresult of identification in operation 1309, for example, when the numberof found electronic pens is one, the processor may establish thecommunication connection with the found electronic pen in operation1335. For example, the processor may determine that the one foundelectronic pen is the electronic pen inserted into the electronic deviceand establish the communication connection. The processor may perform averification procedure for identifying whether the one found electronicpen is the inserted electronic pen through the various methods describedwith reference to FIG. 11. This is because one electronic pen insertedinto another electronic device or one electronic pen located outside theelectronic device may be found while the broken electronic pen isinserted into the electronic device.

Although the above description has been made on the basis of the case inwhich the electronic pen is inserted, the electronic device may performthe operation for the communication connection with the electronic penin various states requiring the communication connection with theelectronic pen, for example, when an application (or an app) using theelectronic pen is executed, when the application (e.g., the app) isterminated from the memory due to an error and then executed again, orwhen the communication connection is disconnected while the electronicpen is inserted.

In another example, the electronic device may perform the operation forthe communication connection with the electronic pen when the electronicdevice is booted (or rebooted). For example, when the power of theelectronic device is turned on, whether information related to theelectronic pen exists is identified in the memory, and when there is norelated information, the operation for the communication connection withthe electronic pen may be performed. For example, when the power of theelectronic device is turned on, charging power may be applied to theelectronic pen inserted into the housing of the electronic devicethrough the wireless charging circuit, and when information related tothe electronic pen does not exist in the memory, the operation forestablishing the communication connection with the electronic pen beingcharged may be performed.

In another example, when information on the electronic pen stored in thememory is initialized, the operation for the communication connectionwith the electronic pen may be performed. For example, when the userexecutes a setting menu and initializes information on the electronicpen even though the electronic pen is inserted into the electronicdevice, is being charged, and is connected for communication, theoperation for the communication connection with the electronic pen maybe performed.

FIG. 14 illustrates an operation for the communication connectionbetween an electronic device and an electronic pen according to anembodiment of the disclosure.

Referring to FIG. 14, an electronic device (e.g., the electronic device20 of FIG. 1) (e.g., the processor of the electronic device) may performcontrol to output a screen for a message making a request for insertingan electronic pen (e.g., the electronic pen 10 of FIG. 1) on a display(e.g., the display device 260 of FIG. 2), as indicated by referencenumeral 1410. For example, when there is no electronic pen connected forcommunication and when the electronic pen is not inserted, theelectronic device may perform control to display the insertion requestscreen on the display. Reference numeral 1410 is only an example, andthe electronic device may provide a request for inserting the electronicpen through any of various methods. For example, the electronic devicemay provide the request for inserting the electronic pen through a popupwindow, a quick panel, or a notification bar.

When the electronic pen is inserted, the electronic device may controlto output a screen (hereinafter referred to as a connection attemptscreen) indicating that establishment of the communication connectionwith the inserted electronic pen is attempted through a wirelesscommunication circuit (e.g., the first wireless communication circuit350 of FIG. 3) to the display, as indicated by reference numeral 1420.At this time, the electronic device may provide charging power to theelectronic pen through the wireless communication circuit (e.g., thefirst wireless communication circuit 350 of FIG. 3), and the electronicpen may output (e.g., broadcast) an advertising signal. Further, theelectronic device may verify whether the inserted electronic pen is thesame as the electronic pen being charged through any of the variousmethods.

When the electronic device performs the communication connection withthe inserted electronic pen, the electronic device may perform controlto output a screen (hereinafter, referred to as a connection completionscreen) indicating that the communication with the electronic pen isconnected to the display, as indicated by reference numeral 1430. When apredetermined time (e.g., 2 seconds) passes from the output of theconnection completion screen, the electronic device may perform controlto output an initial screen (e.g., a home screen) to the display.

When the electronic device does not establish the communicationconnection with the inserted electronic pen, the electronic device maycontrol to output a screen (hereinafter referred to as a non-connectionnotification screen) indicating that the communication with theelectronic pen is not connected to the display, as indicated byreference numeral 1440. The non-connection notification screen mayinclude a retry menu (or button) 1441. When the retry menu 1441 isselected (e.g., touched), the electronic device may perform control tooutput the connection attempt screen 1420 to the display while retryingthe communication connection with the electronic pen. Further, theelectronic device may count up the number of retries when the retry menu1441 is selected.

The non-connection notification screen 1440 may be provided apredetermined number of times (N times). N may be a natural number(e.g., 3). When there is no communication connection between theelectronic device and the electronic pen, whether the number of retriesis smaller than the predetermined number of times is identified. Whenthe number of retries is smaller than the predetermined number of times,the electronic device may perform control to output the non-connectionnotification screen 1440 again to the display.

On the other hand, when the number of retries is the same as thepredetermined number of times, the electronic device cannot establishthe communication connection with the electronic pen, and may performcontrol to output a screen (hereinafter referred to as aconnection-impossible screen) suggesting a visit to a service center tothe display, as indicated by reference numeral 1450. Theconnection-impossible screen may include a close menu 1451. When theclose menu 1451 is selected, the electronic device may control to outputan initial screen (e.g., a home screen) to the display.

The electronic device need not provide the non-connection notificationscreen. For example, when non-connection between the electronic deviceand the electronic pen is displayed on the connection attempt screen1420, the electronic device may perform control to directly output theconnection-impossible screen 1450 to the display.

According to various embodiments of the disclosure, a method ofcontrolling a communication connection of an electronic device (e.g.,the electronic device 10 of FIG. 1, the electronic device 201 of FIG. 2,the electronic device 301 of FIG. 3, the electronic device 502 of FIG.5B, the electronic device 720 of FIGS. 7A and 7B, the electronic device820 of FIG. 8, the electronic device 920 of FIG. 9, the electronicdevice 1001 of FIG. 10, or the electronic device 1120 of FIG. 11) mayinclude an operation of detecting whether an electronic pen (e.g., theelectronic pen 10 of FIG. 1, the electronic pen 400 of FIG. 4, theelectronic pen 51 or 52 of FIG. 5B, the electronic pen 710 of FIGS. 7Aand 7B, the electronic pen 810 of FIG. 8, the electronic pen 910 of FIG.9, the electronic pen 11 of FIG. 10, or the electronic pen 1110 of FIG.11) is inserted into a recess (e.g., the recess 22 of FIG. 1) inside ahousing (e.g., the housing 21 of FIG. 1) of the electronic device, anoperation of charging the electronic pen through a wireless chargingcircuit (e.g., the first wireless charging circuit 340 of FIG. 3) on thebasis of the detection, and an operation of receiving inherentinformation of the electronic pen through a wireless communicationcircuit during or after the charging; and an operation of maintaining orre-establishing the communication connection with the electronic penbased on a portion of the received inherent information.

The wireless communication circuit may support a Bluetooth protocol.

The inherent information may be a Bluetooth address of the electronicpen.

The maintaining or re-establishing of the communication connection maycomprise comparing the received inherent information with referenceinherent information stored in a memory of the electronic device;maintaining the communication connection when the received inherentinformation matches the reference inherent information based on a resultof the comparison; re-establishing the communication connection with theelectronic pen when the received inherent information does not match thereference inherent information based on a result of the comparison.

The re-establishing of the communication connection may comprise atleast one of rebooting the wireless communication circuit; and deletingpairing-related data of a previously connected electronic pen.

The inherent information may be included in an advertising signal of theelectronic pen, and the maintaining or re-establishing of thecommunication connection may comprise randomly turning on or off thewireless charging circuit in response to reception of a plurality ofadvertising signals from a plurality of electronic pens; and maintainingor re-establishing the communication connection based on whether theadvertising signal of the electronic pen or charging-related informationcontained in the advertising signal is synchronized with an on or offpattern of the wireless charging circuit.

The inherent information may be included in an advertising signal of theelectronic pen, and the maintaining or re-establishing of thecommunication connection may comprise making a request for reducing anintensity of the advertising signal of the electronic pen connected forcommunication to a preset size or smaller in response to reception of aplurality of advertising signals from a plurality of electronic pens;maintaining the communication connection with the electronic pen inresponse to continuous reception of the advertising signal having thereduced signal intensity; and re-establishing the communicationconnection with the electronic pen in response to non-reception of theadvertising signal having the reduced signal intensity.

The charging of the electronic pen may comprise applying charging powerto the electronic pen by periodically repeating on/off of the wirescharging circuit, and the electronic pen may be configured to transmitthe advertising signal including the inherent information in an onperiod of the wireless charging circuit, not to transmit the advertisingsignal in an off period of the first wireless charging circuit, totransmit the advertising signal in an on period of the first wirelesscharging circuit, and stop transmission of the advertising signal aftermaintaining the transmission of the advertising signal for apredetermined time after turning off of the first wireless chargingcircuit.

The electronic device according to various embodiments of the disclosuremay connect for communication by identifying an external electronicdevice that needs to be connected for communication. For example, theelectronic device may provide charging power to the external electronicdevice and maintain or re-establish the communication connectionaccording to whether the external electronic device to which thecharging power is being provided is an external electronic device havinga previous communication connection history. According to variousembodiments of the disclosure, when a plurality of external electronicdevices is found, the external electronic device that is inserted intothe electronic device and being charged may be identified (determined)among the plurality of external electronic devices on the basis ofcharging-related information.

The electronic device may be one of various types of electronic devices.The electronic devices may include, for example, a portablecommunication device (e.g., a smartphone), a computer device, a portablemultimedia device, a portable medical device, a camera, a wearabledevice, or a home appliance. The electronic devices are not limited tothose described above.

It should be appreciated that various embodiments of the disclosure andthe terms used therein are not intended to limit the technologicalfeatures set forth herein to particular embodiments and include variouschanges, equivalents, or replacements for a corresponding embodiment.With regard to the description of the drawings, similar referencenumerals may be used to refer to similar or related elements. It is tobe understood that a singular form of a noun corresponding to an itemmay include one or more of the things, unless the relevant contextclearly indicates otherwise. As used herein, each of such phrases as “Aor B,” “at least one of A and B,” “at least one of A or B,” “A, B, orC,” “at least one of A, B, and C,” and “at least one of A, B, or C,” mayinclude any one of, or all possible combinations of the items enumeratedtogether in a corresponding one of the phrases. As used herein, suchterms as “1st” and “2nd,” or “first” and “second” may be used to simplydistinguish a corresponding component from another, and does not limitthe components in other aspect (e.g., importance or order). It is to beunderstood that if an element (e.g., a first element) is referred to,with or without the term “operatively” or “communicatively”, as “coupledwith,” “coupled to,” “connected with,” or “connected to” another element(e.g., a second element), it means that the element may be coupled withthe other element directly (e.g., wiredly), wirelessly, or via a thirdelement.

As used herein, the term “module” may include a unit implemented inhardware, software, or firmware, and may interchangeably be used withother terms, for example, “logic,” “logic block,” “part,” or“circuitry”. A module may be a single integral component, or a minimumunit or part thereof, adapted to perform one or more functions. Forexample, according to an embodiment, the module may be implemented in aform of an application-specific integrated circuit (ASIC).

Various embodiments as set forth herein may be implemented as software(e.g., the program 240) including one or more instructions that arestored in a storage medium (e.g., internal memory 236 or external memory238) that is readable by a machine (e.g., the electronic device 20, theelectronic device 201). For example, a processor (e.g., the processor220) of the machine (e.g., the electronic device 20, the electronicdevice 201) may invoke at least one of the one or more instructionsstored in the storage medium, and execute it, with or without using oneor more other components under the control of the processor. This allowsthe machine to be operated to perform at least one function according tothe at least one instruction invoked. The one or more instructions mayinclude a code generated by a complier or a code executable by aninterpreter. The machine-readable storage medium may be provided in theform of a non-transitory storage medium. The term “non-transitory”simply means that the storage medium is a tangible device, and does notinclude a signal (e.g., an electromagnetic wave), but this term does notdifferentiate between where data is semi-permanently stored in thestorage medium and where the data is temporarily stored in the storagemedium.

According to an embodiment of the disclosure, a method according tovarious embodiments of the disclosure may be included and provided in acomputer program product. The computer program product may be traded asa product between a seller and a buyer. The computer program product maybe distributed in the form of a machine-readable storage medium (e.g.,compact disc read only memory (CD-ROM)), or be distributed (e.g.,downloaded or uploaded) online via an application store (e.g.,PlayStore™), or between two user devices (e.g., smart phones) directly.If distributed online, at least part of the computer program product maybe temporarily generated or at least temporarily stored in themachine-readable storage medium, such as memory of the manufacturer'sserver, a server of the application store, or a relay server.

Each component (e.g., a module or a program) of the above-describedcomponents may include a single entity or multiple entities. One or moreof the above-described components may be omitted, or one or more othercomponents may be added. Alternatively or additionally, a plurality ofcomponents (e.g., modules or programs) may be integrated into a singlecomponent. In such a case, according to various embodiments, theintegrated component may perform one or more functions of each of theplurality of components in the same or similar manner as they areperformed by a corresponding one of the plurality of components beforethe integration. Operations performed by the module, the program, oranother component may be carried out sequentially, in parallel,repeatedly, or heuristically, or one or more of the operations may beexecuted in a different order or omitted, or one or more otheroperations may be added.

While the disclosure has been shown described with reference to variousembodiments thereof, it will be understood by those skilled in the artthat various changes in form and details may be made therein withoutdeparting from the spirit and scope of the disclosure as defined by theappended claims and their equivalents.

What is claimed is:
 1. An electronic device comprising: a housing; atouch-screen display exposed through a portion of the housing; a firstwireless communication circuit disposed inside the housing; a recessdisposed inside the housing; a first wireless charging circuit disposedinside the housing so as to be adjacent to the recess; an electronic pencomprising: a second wireless communication circuit inserted to beremovable from the recess and configured to perform wirelesscommunication with the first wireless communication circuit, and asecond wireless charging circuit electrically coupled to the firstwireless charging circuit; a processor disposed inside the housing andoperatively coupled to the display, the first wireless communicationcircuit, and the first wireless charging circuit; and a memoryoperatively coupled to the processor, wherein the memory storesinstructions causing the processor to, when executed: detect whether theelectronic pen is inserted into the recess, charge the electronic penthrough the first wireless charging circuit based on the detection,receive inherent information of the electronic pen through the firstwireless communication circuit during or after the charging, andmaintain or re-establish a communication connection with the electronicpen based on at least a portion of the received inherent information. 2.The electronic device of claim 1, wherein the first wirelesscommunication circuit supports a Bluetooth protocol.
 3. The electronicdevice of claim 2, wherein the inherent information is a Bluetoothaddress of the electronic pen.
 4. The electronic device of claim 1,wherein the instructions further cause the processor to: store referenceinherent information in the memory, compare the received inherentinformation with the reference inherent information, and maintain orre-establish the communication connection according to a result of thecomparison.
 5. The electronic device of claim 1, wherein re-establishingthe communication connection comprises at least one of rebooting of atleast one of the first wireless communication circuit or the secondwireless communication circuit or a deletion of pairing-related data. 6.The electronic device of claim 5, wherein the inherent information isincluded in an advertising signal of the electronic pen, and wherein theinstructions further cause the processor to randomly turn on or off thefirst wireless charging circuit in response to reception of a pluralityof advertising signals from a plurality of electronic pens and maintainor re-establish the communication connection based on whether theadvertising signal is synchronized with an on or off pattern of thefirst wireless charging circuit of the plurality of electronic pens. 7.The electronic device of claim 5, wherein the inherent information isincluded in an advertising signal of the electronic pen, and wherein theinstructions further cause the processor to randomly turn on or off thefirst wireless charging circuit in response to reception of a pluralityof advertising signals from a plurality of electronic pens and maintainor re-establish the communication connection based on whethercharging-related information included in the advertising signal issynchronized with an on or off pattern of the first wireless chargingcircuit of the plurality of electronic pens.
 8. The electronic device ofclaim 5, wherein the inherent information is included in an advertisingsignal of the electronic pen, and wherein the instructions further causethe processor to: make a request for reducing an intensity of theadvertising signal of the electronic pen connected for communication toa preset size or smaller in response to reception of a plurality ofadvertising signals from a plurality of electronic pens, maintain thecommunication connection with the electronic pen in response tocontinuous reception of the advertising signal having the reduced signalintensity, and re-establish the communication connection with theelectronic pen in response to non-reception of the advertising signalhaving the reduced signal intensity.
 9. The electronic device of claim1, wherein the instructions further cause the processor to providenotification that the electronic pen inserted into the recess has anerror when the inherent information is not received.
 10. The electronicdevice of claim 1, wherein the instructions further cause the processorto apply charging power to the electronic pen by periodically repeatingon and off of the first wireless charging circuit.
 11. The electronicdevice of claim 10, wherein the electronic pen is configured to:transmit the advertising signal including the inherent information in anon period of the first wireless charging circuit, not transmit theadvertising signal in an off period of the first wireless chargingcircuit, transmit the advertising signal in an on period of the firstwireless charging circuit, and stop transmission of the advertisingsignal after maintaining the transmission of the advertising signal fora predetermined time after turning off of the first wireless chargingcircuit.
 12. A method of controlling a communication connection by anelectronic device, the method comprising: detecting whether anelectronic pen is inserted into a recess inside a housing of theelectronic device; charging the electronic pen through a wirelesscharging circuit based on the detection; receiving inherent informationof the electronic pen through a wireless communication circuit during orafter the charging; and maintaining or re-establishing the communicationconnection with the electronic pen based on a portion of the receivedinherent information.
 13. The method of claim 12, wherein the wirelesscommunication circuit supports a Bluetooth protocol.
 14. The method ofclaim 13, wherein the inherent information is a Bluetooth address of theelectronic pen.
 15. The method of claim 12, wherein the maintaining orre-establishing of the communication connection comprises: comparing thereceived inherent information with reference inherent information storedin a memory of the electronic device; maintaining the communicationconnection when the received inherent information matches the referenceinherent information based on a result of the comparison; andre-establishing the communication connection with the electronic penwhen the received inherent information does not match the referenceinherent information based on a result of the comparison.
 16. The methodof claim 12, wherein the re-establishing of the communication connectioncomprises at least one of: rebooting the wireless communication circuit;or deleting pairing-related data of a previously connected electronicpen.
 17. The method of claim 16, wherein the inherent information isincluded in an advertising signal of the electronic pen, and wherein themaintaining or re-establishing of the communication connectioncomprises: randomly turning on or off the wireless charging circuit inresponse to reception of a plurality of advertising signals from aplurality of electronic pens, and maintaining or re-establishing thecommunication connection based on whether the advertising signal of theelectronic pen or charging-related information contained in theadvertising signal is synchronized with an on or off pattern of thewireless charging circuit.
 18. The method of claim 16, wherein theinherent information is included in an advertising signal of theelectronic pen, and wherein the maintaining or re-establishing of thecommunication connection comprises: making a request for reducing anintensity of the advertising signal of the electronic pen connected forcommunication to a preset size or smaller in response to reception of aplurality of advertising signals from a plurality of electronic pens,maintaining the communication connection with the electronic pen inresponse to continuous reception of the advertising signal having thereduced signal intensity, and re-establishing the communicationconnection with the electronic pen in response to non-reception of theadvertising signal having the reduced signal intensity.
 19. The methodof claim 12, wherein the charging of the electronic pen comprisesapplying charging power to the electronic pen by periodically repeatingon/off of the wires charging circuit, and wherein the electronic pen isconfigured to: transmit the advertising signal including the inherentinformation in an on period of the wireless charging circuit, nottransmit the advertising signal in an off period of the first wirelesscharging circuit, transmit the advertising signal in an on period of thefirst wireless charging circuit, and stop transmission of theadvertising signal after maintaining the transmission of the advertisingsignal for a predetermined time after turning off of the first wirelesscharging circuit.
 20. An electronic device comprising: a housing; atouch-screen display exposed through a portion of the housing; a firstwireless communication circuit disposed inside the housing; a recessdisposed inside the housing; a first wireless charging circuit disposedinside the housing to be adjacent to the recess; a processor disposedinside the housing and operatively coupled to the display, the firstwireless communication circuit, and the first wireless charging circuit;and a memory operatively coupled to the processor, wherein the memorystores instructions causing the processor to, when executed: detectwhether an electronic pen is inserted into the recess, charge theelectronic pen through the first wireless charging circuit based atleast in part on the detection, perform a scan through the firstwireless communication circuit in order to identify information on theelectronic pen, turn on or off the first wireless charging circuit in apredetermined pattern in response to discovery of a plurality ofelectronic pens through the scan, identify the electronic pen insertedinto the recess among the plurality of electronic pens based oncharging-related information included in advertising signals receivedfrom the plurality of found electronic pens, and establish acommunication connection with the identified electronic pen.